#ifndef CTEXTCLASS_H
#define CTEXTCLASS_H

#include "FontClass.h"
#include "FontShaderClass.h"

class CTextClass
{
	struct SentenceType
	{
		ID3D11Buffer* pVertexBuffer;
		ID3D11Buffer* pIndexBuffer;
		int nVertexCount;
		int nIndexCount;
		int nMaxLength;
		float fRed;
		float fGreen;
		float fBlue;
	};

	struct VertexType
	{
		D3DXVECTOR3 d3dPosition;
		D3DXVECTOR2 d3dTexture;
	};

	CFontClass* m_pFont;
	CFontShaderClass* m_pFontShader;
	SentenceType* m_pSentence1;
	SentenceType* m_pSentence;
	D3DXMATRIX m_d3dBaseViewMatrix;
	int m_nScreenWidth;
	int m_nScreenHeight;
	

	bool InitializeSentence(SentenceType** pSentence, int nMaxLength, ID3D11Device* pDevice);
	bool UpdateSentence(SentenceType* pSentence, char* cText, int nXPos, int nYPos, float fRed, float fGreen, float fBlue, ID3D11DeviceContext* pDeviceContext);
	void ReleaseSentence(SentenceType** pSentence);
	bool RenderSentence(ID3D11DeviceContext* pDeviceContext, SentenceType* pSentence, D3DXMATRIX d3dWorld, D3DXMATRIX d3dOrtho);

public:
	CTextClass(void);
	CTextClass(const CTextClass&);
	~CTextClass(void);

	bool Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pDeviceContext, HWND hWnd, int nScreenWidth, int nScreenHeight, D3DXMATRIX d3dBaseViewMatrix);
	void ShutDown();
	bool Render(ID3D11DeviceContext* pDeviceContext, D3DXMATRIX d3dWorld, D3DXMATRIX d3dOrtho);
	bool SetMousePosition(int nXPos, int nYPos, ID3D11DeviceContext* pDeviceContext);
	bool SetFPS(int nFPS, ID3D11DeviceContext* pDeviceContext);
	bool SetCPU(int nCPU, ID3D11DeviceContext* pDeviceContext);

	bool SetRenderCount(int nRenderCount, ID3D11DeviceContext* pDeviceContext);

};

#endif